home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PRINTER / JPSRC11.ARJ / JETMEAN.C < prev    next >
C/C++ Source or Header  |  1991-08-03  |  11KB  |  364 lines

  1. /*
  2.  *      JET PAK - HP DeskJet and LaserJet series printer utilities
  3.  *
  4.  *      JETMEAN module - field meaning utilities
  5.  *
  6.  *      Version 1.1 (Public Domain)
  7.  */
  8.  
  9. /* system include files */
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13.  
  14. /* application include files */
  15. #include "jetfont.h"
  16. #include "jetmean.h"
  17.  
  18. static char retstr[100];
  19.  
  20. char *header_format_meaning(header_format)
  21. UNSIGNEDBYTE header_format;
  22. {
  23.     switch (header_format)
  24.     {
  25.     case    LJFONTFORMAT: return("LaserJet");
  26.     case    DJFONTFORMAT: return("DeskJet Series");
  27.     case   DJPFONTFORMAT: return("DeskJet PLUS");
  28.     case DJ500FONTFORMAT: return("DeskJet 500");
  29.     default             : sprintf(retstr, "Unrecognised [%u]", header_format);
  30.                           return(retstr);
  31.     }
  32. }
  33.  
  34. char *font_type_meaning(font_type)
  35. UNSIGNEDBYTE font_type;
  36. {
  37.     switch (font_type)
  38.     {
  39.     case FONT_TYPE_7BIT: return("7-bit");
  40.     case FONT_TYPE_8BIT: return("8-bit");
  41.     case  FONT_TYPE_IBM: return("PC-8");
  42.     default            : sprintf(retstr, "Unrecognised [%u]", font_type);
  43.                          return(retstr);
  44.     }
  45. }
  46.  
  47. char *orientation_meaning(orientation)
  48. UNSIGNEDBYTE orientation;
  49. {
  50.     switch (orientation)
  51.     {
  52.     case   PORTRAIT: return("Portrait");
  53.     case  LANDSCAPE: return("Landscape");
  54.     default        : sprintf(retstr, "Unrecognised [%u]", orientation);
  55.                      return(retstr);
  56.     }
  57. }
  58.  
  59. char *spacing_meaning(spacing)
  60. BOOLEAN spacing;
  61. {
  62.     switch (spacing)
  63.     {
  64.     case         FIXED: return("Fixed");
  65.     case  PROPORTIONAL: return("Proportional");
  66.     default           : sprintf(retstr, "Unrecognised [%u]", spacing);
  67.                         return(retstr);
  68.     }
  69. }
  70.  
  71. char *style_meaning(style)
  72. UNSIGNEDINT style;
  73. {
  74.     switch (style)
  75.     {
  76.     case  0: return("Upright");
  77.     case  1: return("Italics");
  78.     case  2: return("Slant");
  79.     default: sprintf(retstr, "Unrecognised [%u]", style);
  80.              return(retstr);
  81.     }
  82. }
  83.  
  84. char *symbol_set_meaning(symbol_set)
  85. UNSIGNEDINT symbol_set;
  86. {
  87.  
  88.     sprintf(retstr, "%d%c ", symbol_set/32, '@'+symbol_set%32);
  89.  
  90.     switch (symbol_set)
  91.     {
  92.     case   1: strcat(retstr, "[HP Math-7]"); break;
  93.     case   2: strcat(retstr, "[HP Line Draw]"); break;
  94.     case   4: strcat(retstr, "[ISO 60: Norwegian version 1]"); break;
  95.     case  36: strcat(retstr, "[ISO 61: Norwegian version 2]"); break;
  96.     case   5: strcat(retstr, "[HP Roman Extensions]"); break;
  97.     case  37: strcat(retstr, "[ISO 4: United Kingdom]"); break;
  98.     case   6: strcat(retstr, "[ISO 25: French]"); break;
  99.     case  38: strcat(retstr, "[ISO 69: French]"); break;
  100.     case   7: strcat(retstr, "[HP German]"); break;
  101.     case  39: strcat(retstr, "[ISO 21: German]"); break;
  102.     case 263: strcat(retstr, "[HP Greek-8]"); break;
  103.     case   9: strcat(retstr, "[ISO 15: Italian]"); break;
  104.     case  11: strcat(retstr, "[ISO 14: JIS ASCII]"); break;
  105.     case  75: strcat(retstr, "[ISO 57: Chinese]"); break;
  106.     case 267: strcat(retstr, "[Kana-8]"); break;
  107.     case  12: strcat(retstr, "[LineDraw]"); break;
  108.     case  13: strcat(retstr, "[Math7]"); break;
  109.     case  45: strcat(retstr, "[Technical-7]"); break;
  110.     case 269: strcat(retstr, "[HP Math-8]"); break;
  111.     case  14: strcat(retstr, "[ISO 100: ECMA-94 (Latin 1)]"); break;
  112.     case  15: strcat(retstr, "[OCR A]"); break;
  113.     case  47: strcat(retstr, "[OCR B]"); break;
  114.     case  17: strcat(retstr, "[Math8a]"); break;
  115.     case  49: strcat(retstr, "[Math8b]"); break;
  116.     case  81: strcat(retstr, "[Pi Font A]"); break;
  117.     case  19: strcat(retstr, "[ISO 11: Swedish]"); break;
  118.     case  51: strcat(retstr, "[HP Spanish]"); break;
  119.     case  83: strcat(retstr, "[ISO 17: Spanish]"); break;
  120.     case 115: strcat(retstr, "[ISO 10: Spanish]"); break;
  121.     case 147: strcat(retstr, "[ISO 16: Portuguese]"); break;
  122.     case 179: strcat(retstr, "[ISO 84: Portuguese]"); break;
  123.     case 211: strcat(retstr, "[ISO 85: Spanish]"); break;
  124.     case  21: strcat(retstr, "[ISO 6: ASCII]"); break;
  125.     case  53: strcat(retstr, "[HP Legal]"); break;
  126.     case  85: strcat(retstr, "[ISO 2: Intl Reference Version]"); break;
  127.     case 245: strcat(retstr, "[OEM-1]"); break;
  128.     case 277: strcat(retstr, "[HP Roman-8]"); break;
  129.     case 341: strcat(retstr, "[PC-8]"); break;
  130.     case 373: strcat(retstr, "[PC-8 (D/N)]"); break;
  131.     case 405: strcat(retstr, "[PC-850]"); break;
  132.     case 501: strcat(retstr, "[HP Pi Font]"); break;
  133.     default : strcat(retstr, "[Unrecognised]"); break;
  134.     }
  135.  
  136.     return(retstr);
  137. }
  138.  
  139. char *width_type_meaning(width_type)
  140. SIGNEDBYTE width_type;
  141. {
  142.     switch (width_type)
  143.     {
  144.     case -2: return("Condensed");
  145.     case -1: return("Semi-condensed");
  146.     case  0: return("Normal");
  147.     case  1: return("Semi-expanded");
  148.     case  2: return("Expanded");
  149.     default: sprintf(retstr, "Unrecognised [%d]", width_type);
  150.              return(retstr);
  151.     }
  152. }
  153.  
  154. char *typeface_meaning(typeface)
  155. UNSIGNEDINT typeface;
  156. {
  157.     switch (typeface)
  158.     {
  159.     case    0: return("Line Printer");
  160.     case    1: return("Pica");
  161.     case    2: return("Elite");
  162.     case    3: return("Courier");
  163.     case    4: return("Helvetica");
  164.     case    5: return("Times Roman");
  165.     case    6: return("Letter Gothic");
  166.     case    7: return("Script");
  167.     case    8: return("Prestige");
  168.     case    9: return("Caslon");
  169.     case   10: return("Orator");
  170.     case   11: return("Presentations");
  171.     case   12: return("Helvetica Condensed");
  172.     case   13: return("Serifa");
  173.     case   14: return("Futura");
  174.     case   15: return("Palatino");
  175.     case   16: return("ITC-Souvenir");
  176.     case   17: return("Optima");
  177.     case   18: return("Garamond");
  178.     case   19: return("Cooper Black");
  179.     case   20: return("Coronet Bold");
  180.     case   21: return("Broadway");
  181.     case   22: return("Bauer Bodoni Black Condensed");
  182.     case   23: return("Century Schoolbook");
  183.     case   24: return("University Roman");
  184.     case   25: return("Helvetica Outline");
  185.     case   26: return("Futura Condensed");
  186.     case   27: return("ITC-Korinna");
  187.     case   28: return("Arabic");
  188.     case   29: return("Cloister Black");
  189.     case   30: return("ITC-Galliard");
  190.     case   31: return("Avant Garde");
  191.     case   32: return("Brush");
  192.     case   33: return("Blippo");
  193.     case   34: return("Hobo");
  194.     case   35: return("Windsor");
  195.     case   36: return("Helvetica Compressed");
  196.     case   37: return("Helvetica Extra Condensed");
  197.     case   38: return("Peignot");
  198.     case   39: return("Baskerville");
  199.     case   40: return("Garamond Condensed");
  200.     case   41: return("Trade Gothic");
  201.     case   42: return("Goudy Old Style");
  202.     case   43: return("Zapf-Chancery");
  203.     case   44: return("Clarendon");
  204.     case   45: return("Zapf-Dingbats");
  205.     case   46: return("Cooper");
  206.     case   47: return("ITC-Bookman");
  207.     case   48: return("Stick");
  208.     case   49: return("HP-GLSpline");
  209.     case   50: return("HP-GLDrafting");
  210.     case   51: return("Gill Sans");
  211.     case   52: return("Univers");
  212.     case   53: return("Bodini");
  213.     case   54: return("Rockwell");
  214.     case   55: return("Melior");
  215.     case   56: return("ITC-Tiffany");
  216.     case   57: return("ITC-Clearface");
  217.     case   58: return("Amelia");
  218.     case   59: return("Park Avenue");
  219.     case   60: return("Handel Gothic");
  220.     case   61: return("Dom Casual");
  221.     case   62: return("ITC-Benguiat");
  222.     case   63: return("ITC-Cheltenham");
  223.     case   64: return("Century Expanded");
  224.     case   65: return("Franklin Gothic");
  225.     case   66: return("Franklin Expressed");
  226.     case   67: return("Franklin Extra Condensed");
  227.     case   68: return("Plantin");
  228.     case   69: return("Trump Medieval");
  229.     case   70: return("Futura Black");
  230.     case   72: return("Chancelor");
  231.     case   73: return("Broadway");
  232.     case   75: return("Greek");
  233.     case   85: return("Univers Condensed");
  234.     case  100: return("Logo");
  235.     case  103: return("Symbol");
  236.     case  118: return("Coop");
  237.     case  119: return("Abbey");
  238.     case  120: return("Beget");
  239.     case  121: return("Orna");
  240.     case  122: return("Avanti");
  241.     case  123: return("American Type");
  242.     case  124: return("Basque");
  243.     case  125: return("Gillies");
  244.     case  126: return("Olivia");
  245.     case  127: return("Galaxy");
  246.     case  136: return("Bitstream Charter");
  247.     case  200: return("Old English");
  248.     case  230: return("Rockland");
  249.     case 4101: return("CG Times Ver. 0");
  250.     default  : sprintf(retstr, "Unrecognised [%u]", typeface);
  251.                return(retstr);
  252.  
  253.     }
  254. }
  255.  
  256. char *stroke_weight_meaning(stroke_weight)
  257. SIGNEDBYTE stroke_weight;
  258. {
  259.     switch (stroke_weight)
  260.     {
  261.     case -7: return("Thin");
  262.     case -6:
  263.     case -5:
  264.     case -4: return("Thin to Light");
  265.     case -3: return("Light");
  266.     case -2:
  267.     case -1: return("Light to Medium");
  268.     case  0: return("Medium");
  269.     case  1:
  270.     case  2: return("Medium to Bold");
  271.     case  3: return("Bold");
  272.     case  4:
  273.     case  5:
  274.     case  6: return("Bold to Thick");
  275.     case  7: return("Thick");
  276.     default: sprintf(retstr, "Unrecognised [%d]", stroke_weight);
  277.              return(retstr);
  278.     }
  279. }
  280.  
  281. char *serif_style_meaning(serif_style)
  282. UNSIGNEDBYTE serif_style;
  283. {
  284.     switch (serif_style)
  285.     {
  286.     case  0: return("Sans Serif Square");
  287.     case  1: return("Sans Serif Round");
  288.     case  2: return("Serif Line");
  289.     case  3: return("Serif Triangle");
  290.     case  4: return("Serif Swath");
  291.     case  5: return("Serif Block");
  292.     case  6: return("Serif Bracket");
  293.     case  7: return("Rounded Bracket");
  294.     case  8: return("Flair Stroke");
  295.     default: sprintf(retstr, "Unrecognised [%u]", serif_style);
  296.              return(retstr);
  297.     }
  298. }
  299.  
  300. char *quality_meaning(quality)
  301. UNSIGNEDBYTE quality;
  302. {
  303.     switch (quality)
  304.     {
  305.     case  0: return("Data Processing (Draft)");
  306.     case  1: return("Near Letter Quality");
  307.     case  2: return("Letter Quality");
  308.     default: sprintf(retstr, "Unrecognised [%u]", quality);
  309.              return(retstr);
  310.     }
  311. }
  312.  
  313. char *placement_meaning(placement)
  314. SIGNEDBYTE placement;
  315. {
  316.     switch (placement)
  317.     {
  318.     case -1: return("Superior (superscript)");
  319.     case  0: return("Normal");
  320.     case  1: return("Inferior (subscript)");
  321.     default: sprintf(retstr, "Unrecognised [%d]", placement);
  322.              return(retstr);
  323.     }
  324. }
  325.  
  326. char *char_format_meaning(char_format)
  327. UNSIGNEDBYTE char_format;
  328. {
  329.     switch (char_format)
  330.     {
  331.     case    LJCHARFORMAT: return("LJ");
  332.     case    DJCHARFORMAT: return("DJ");
  333.     case   DJPCHARFORMAT: return("DJ+");
  334.     case DJ500CHARFORMAT: return("DJ500");
  335.     default             : return("?");
  336.     }
  337. }
  338.  
  339. char *char_type_meaning(char_type)
  340. UNSIGNEDBYTE char_type;
  341. {
  342.     switch (char_type)
  343.     {
  344.     case CHAR_TYPE_NORMAL: return("SP");
  345.     case  CHAR_TYPE_PASS1: return("MP 1");
  346.     case  CHAR_TYPE_PASS2: return("MP 2");
  347.     case  CHAR_TYPE_PASS3: return("MP 3");
  348.     case  CHAR_TYPE_PASS4: return("MP 4");
  349.     default              : return("?");
  350.     }
  351. }
  352.  
  353. char *boolean_meaning(which)
  354. BOOLEAN which;
  355. {
  356.     switch (which)
  357.     {
  358.     case  0: return("No");
  359.     case  1: return("Yes");
  360.     default: sprintf(retstr, "Unrecognised [%u]", which);
  361.              return(retstr);
  362.     }
  363. }
  364.